home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 11 - 1995 / 11.04 Apr 95 / Performance / Fractal 6 / Fractal.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-13  |  2.1 KB  |  94 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:            Fractal.h
  3.     
  4.     Used to build:    “Fractal 6”
  5.     
  6.     Written by:        Jim Cathey            July 1985
  7.                     Eric Traut            November 1994
  8.  
  9.     Description:
  10.         See comments in the file “FractalMain.c” for more
  11.         information.
  12. */
  13.  
  14. #include <QDOffscreen.h>
  15.  
  16. /* Menu information */
  17. enum {
  18.     kMenuBarID            = 128,
  19.     kAppleMenuID        = 128,
  20.     kAboutBoxItem        = 1,
  21.     kFileMenuID            = 129,
  22.     kNewFractalItem        = 1,
  23.     kQuitItem            = 3,
  24.     kEditMenuID            = 130,
  25.     kOptionsMenuID        = 131,
  26.     kSetupItem            = 1,
  27.     kContinuousItem        = 3
  28. };
  29.  
  30. /* Window, dialog, and alert constants */
  31. enum {
  32.     kMainWindowID            = 260,
  33.     kAboutBox1DialogID        = 256,
  34.     kAboutBoxOKButtonID        = 1,
  35.     kAboutBoxMoreButtonID    = 2,
  36.     kAboutBox2DialogID        = 257,
  37.     kFatalErrorAlertID        = 128
  38. };
  39.  
  40. /* Setup dialog constants */
  41. enum {
  42.     kSetUpDialogID            = 258,
  43.     kSetUpOKButtonID        = 1,
  44.     kSetUpCancelButtonID    = 2,
  45.     kSetUpLevelID            = 4,
  46.     kSetUpMtnButtonID        = 5,
  47.     kSetUpHillsButtonID        = 6,
  48.     kSetUpWaterButtonID        = 7
  49. };
  50.  
  51. /* Style and level constants */
  52. enum {
  53.     kStyleMountains            = kSetUpMtnButtonID,
  54.     kStyleHills                = kSetUpHillsButtonID,
  55.     kStyleWater                = kSetUpWaterButtonID,
  56.     kMaxLevel                = 7,
  57.     kDefaultStyle            = kStyleWater,
  58.     kDefaultLevel            = 6
  59. };
  60.  
  61. enum {
  62.     kMaxXPoint                = ((1 << kMaxLevel) + 1),
  63.     kMaxYPoint                = ((1 << (kMaxLevel - 1)) + 1)
  64. };
  65.  
  66. /* Screen constants */
  67. enum {
  68.     kOriginalScreenX        = 512,
  69.     kOriginalScreenY        = 300,
  70.     kNewScreenX                = 630,
  71.     kNewScreenY                = 434,
  72.     kScaleShift                = 5,
  73.     kScreenBoundaryBits        = 5,
  74.     kWindowTitleHeight        = 16
  75. };
  76.  
  77. /* Global variables used in multiple files */
  78. extern short (*gPointArray)[kMaxXPoint][kMaxYPoint];
  79.                                             /* The array of points to be subdivided. */
  80. extern short gContourType;                    /* Contour type */
  81. extern short gContourLevel;                    /* Level of detail */
  82. extern long gTotalTickCount;                /* Total time spent calculating and drawing */
  83. extern long gTotalFractals;                    /* Total fractal count */
  84. extern Boolean gFractalChanged;                /* Should this screen update be counted? */
  85. extern GWorldPtr gOffscreenGWorld;            /* GWorld for faster drawing */
  86. extern PixMapHandle    gOffscreenPixMap;        /* Offscreen PixMap */
  87. extern WindowPtr gMainWindow;                /* Our one window */
  88.  
  89.  
  90. void CalcSurface(unsigned short level);
  91. void PlotData(void);
  92.  
  93.  
  94.